SFML_INC := "e:/lib/sfml-1.5/include"
BOOST_INC := "e:/boost/boost_1_39_0"
SFML_LIB := "e:/lib/sfml-1.5/lib/mingw"
BOX2D_INC := "e:\lib\Box2D\include"
BOX2D_LIB := "e:\lib\Box2D\library"
CEGUI_INC :="e:/lib/cegui/include"
CEGUI_RENDER_INC :="e:/lib/cegui"
CEGUI_LIB :="e:/lib/cegui/lib"
CEGUI_DLL :="e:/lib/cegui/bin"
CEGUI_DEP_LIB :="e:/lib/cegui/dependencies/lib"
L_FLAG ?= -g
C_FLAG ?= -g
main.exe : main.o actor.o testactor.o actor_manager.o mousecontroller.o thinker.o drawer.o \
game_graph.o mover.o tile_actor.o
	g++ $(L_FLAG) -o $@ $^ -L $(SFML_LIB) -lsfml-graphics-s -lsfml-window-s -lsfml-system-s \
-L $(BOX2D_LIB) -lbox2dd
main.o : main.cpp indexresource.hpp actor.hpp actor_manager.hpp message.hpp actor_creater.hpp mousecontroller.hpp \
thinker.hpp drawer.hpp game_graph.hpp mover.hpp tile_actor.hpp
	g++ $(C_FLAG) -c -o $@ $< -I $(SFML_INC) -I $(BOX2D_INC) -I $(BOOST_INC)
actor.o : actor.cpp actor.hpp actor_creater.hpp actor_manager.hpp thinker.hpp drawer.hpp mover.hpp
	g++ $(C_FLAG) -c -o $@ $< -I $(SFML_INC) -I $(BOX2D_INC) -I $(BOOST_INC)
testactor.o : testactor.cpp testactor.hpp actor.hpp thinker.hpp drawer.hpp mover.hpp
	g++ $(C_FLAG) -c -o $@ $< -I $(SFML_INC) -I $(BOX2D_INC) -I $(BOOST_INC)
actor_manager.o : actor_manager.cpp actor_manager.hpp message.hpp actor.hpp thinker.hpp drawer.hpp
	g++ $(C_FLAG) -c -o $@ $< -I $(SFML_INC) -I $(BOX2D_INC) -I $(BOOST_INC)
mousecontroller.o : mousecontroller.cpp actor.hpp actor_manager.hpp mousecontroller.hpp thinker.hpp drawer.hpp tile_actor.hpp
	g++ $(C_FLAG) -c -o $@ $< -I $(SFML_INC) -I $(BOX2D_INC) -I $(BOOST_INC)
thinker.o : thinker.cpp thinker.hpp message.hpp message_handler.hpp
	g++ $(C_FLAG) -c -o $@ $< -I $(BOOST_INC)
drawer.o : drawer.cpp drawer.hpp thinker.hpp
	g++ $(C_FLAG) -c -o $@ $< -I $(BOOST_INC) -I $(SFML_INC)
game_graph.o : game_graph.cpp game_graph.hpp message_handler.hpp drawer.hpp message.hpp thinker.hpp
	g++ $(C_FLAG) -c -o $@ $< -I $(BOOST_INC) -I $(SFML_INC)
mover.o : mover.cpp mover.hpp thinker.hpp drawer.hpp message.hpp
	g++ $(C_FLAG) -c -o $@ $< -I $(BOOST_INC) -I $(SFML_INC)
tile_actor.o : tile_actor.cpp tile_actor.hpp mover.hpp message.hpp message_handler.hpp thinker.hpp
	g++ $(C_FLAG) -c -o $@ $< -I $(BOOST_INC) -I $(SFML_INC)
guitest.exe : guitest.o
	g++ $(L_FLAG) -o $@ $^ -L $(SFML_LIB) -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lglu32 -opengl -L $(CEGUI_LIB) -lCEGUIbase \
-lOpenGLGUIRenderer_Static \
-lCEGUIDevILImageCodec_Static \
-lceguisillyimagecodec_Static \
-lceguicoronaimagecodec_Static \
-lceguitgaimagecodec_static \
-L $(CEGUI_DEP_LIB) -lsilly -lexpat -lpcre \
-lceguifalagardwrbase_Static
guitest.o : guitest.cpp
	g++ $(C_FLAG) -c -o $@ $< -I $(BOOST_INC) -I $(SFML_INC) -I $(CEGUI_INC) -I $(CEGUI_RENDER_INC)

.PHONY : guitest
guitest : guitest.exe
	./guitest.exe
.PHONY : test
test : testgamemap2.exe
	testgamemap2
.PHONY : run
run :
	main
.PHONY : clean
clean :
	rm *.o
	rm main.exe
